package com.wondertek.poms.dao.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

/**
 * @author gaozhengxing gaozhenghang@wondertek.com.cn
 * @date 2020/12/30 11:26
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ProductVo {

    private String prdContId;
    private String contentId;
    private String productId;
    private String equityId;
    private String equityCode;
    private String groupName;
    private String productName;
    /**计费模式 方式*/
    private String chargeMode;
    /**定价*/
    private String price;

    private String type;
    private String channelPackage;
    private String channelPackageName;

    public static ProductVo fromTo(ProductVo little,ProductVo many){
        if(many.getPrdContId()==null && StringUtils.isNotBlank(little.getPrdContId())){
            many.setPrdContId(little.getPrdContId());
        }
        if(many.getContentId()==null && StringUtils.isNotBlank(little.getContentId())){
            many.setContentId(little.getContentId());
        }
        if(many.getProductId()==null && StringUtils.isNotBlank(little.getProductId())){
            many.setProductId(little.getProductId());
        }
        if(many.getEquityId()==null && StringUtils.isNotBlank(little.getEquityId())){
            many.setEquityId(little.getEquityId());
        }
        if(many.getEquityCode()==null && StringUtils.isNotBlank(little.getEquityCode())){
            many.setEquityCode(little.getEquityCode());
        }
        if(many.getGroupName()==null && StringUtils.isNotBlank(little.getGroupName())){
            many.setGroupName(little.getGroupName());
        }
        if(many.getProductName()==null && StringUtils.isNotBlank(little.getProductName())){
            many.setProductName(little.getProductName());
        }
        if(many.getChargeMode()==null && StringUtils.isNotBlank(little.getChargeMode())){
            many.setChargeMode(little.getChargeMode());
        }
        if(many.getPrice()==null && StringUtils.isNotBlank(little.getPrice())){
            many.setPrice(little.getPrice());
        }
        if(many.getType()==null && StringUtils.isNotBlank(little.getType())){
            many.setType(little.getType());
        }
        if(many.getChannelPackage()==null && StringUtils.isNotBlank(little.getChannelPackage())){
            many.setChannelPackage(little.getChannelPackage());
        }
        if(many.getChannelPackageName()==null && StringUtils.isNotBlank(little.getChannelPackageName())){
            many.setChannelPackageName(little.getChannelPackageName());
        }
        return many;
    }
}
